package com.base.service.impl;


import com.base.mapper.voipmapper.BrowseRecordsMapper;

import com.base.po.br.BrowseRecords;
import com.base.service.BrowseRecordsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class BrowseRecordsServiceImpl implements BrowseRecordsService {

    @Autowired
    private BrowseRecordsMapper browseRecordsMapper;


    @Override
    @Transactional
    public int insertBrowseRecord(BrowseRecords browseRecords) {
        return browseRecordsMapper.insertSelective(browseRecords);
    }

    @Override
    public List<BrowseRecords> findUserBrowseRecordsByUid(String uId, int start, int num) {
        return browseRecordsMapper.selectByUid(uId,start,num);
    }

    @Override
    public List<BrowseRecords> findUserBrowseRecords(String uId,String parentId) {
        return browseRecordsMapper.selectUserBrowseRecord(uId,parentId);
    }

    @Override
    @Transactional
    public boolean updateUserBrowseRecord(BrowseRecords browseRecords) {
        return browseRecordsMapper.updateBrowseRecord(browseRecords);
    }

    @Override
    public BrowseRecords findsignleUserBr(String uId, String comId) {
        return browseRecordsMapper.findsignleUserBr(uId,comId);
    }

    @Override
    public List<BrowseRecords> findParentBrowseRecords(String parentId) {
        return null;
    }

    @Override
    public boolean updateUserBrowseRecordByComIdAndUid(BrowseRecords browseRecords) {
        return browseRecordsMapper.updateUserBrowseRecordByComIdAndUid(browseRecords);
    }

    @Override
    public BrowseRecords selectIsExist(String uid, String comId, Integer apiPro, String parentId) {
        return browseRecordsMapper.selectIsExist(uid, comId, apiPro, parentId);
    }

}
